let arr = [14,7,31,23,9,18,26,3,15];

let target = [
    [7,9,14,18,23,3,15,26,31],
    [7,14,23,9,18,26,3,31,15],
    [7,14,9,23,26,18,3,15,31],
    [7,14,31,23,9,18,26,3,15]
].map(_ => _.join('_'));
let maopao = function () {
    var tmp = 0;
    var t = 0;
    var copyArr = [];
    for (let i = 0;i < target.length;i++) {
        tmp = i;
        for (var j = i + 1;j < target.length;j++) {
            if (arr[tmp] > arr[j]) {
                t = arr[tmp];
                arr[tmp] = arr[j];
                arr[j] = t;
                tmp = j;
            }
            target = target.filter(_ => {
                return !(_ === arr.join('_'));
            });
        }
    }
};
maopao();
console.log(target);
